package com.lanjiu.lib.imclient.dto.user;

import com.lanjiu.pro.business.BusinessProtocolEntities;
import com.lanjiu.lib.imclient.dto.base.Dto;

/**
 * @description: 临时用户
 * @author: Panwei
 * @date: 2019/11/14 16:11
 */
public class TouristsUserDto extends Dto {
    // 游客用户ID
    private String temporaryId;

    // 游客用户昵称
    private String nickname;

    // 游客用户头像
    private String avatar;

    public TouristsUserDto() {
    }

    public String getTemporaryId() {
        return temporaryId;
    }

    public void setTemporaryId(String temporaryId) {
        this.temporaryId = temporaryId;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public TouristsUserDto(BusinessProtocolEntities.TouristsUser touristsUser) {
        this.temporaryId = touristsUser.getTemporaryId();
        this.nickname = touristsUser.getNickname();
        this.avatar = touristsUser.getAvatar();
    }

    @Override
    public BusinessProtocolEntities.TouristsUser toProtobuf() {
        BusinessProtocolEntities.TouristsUser.Builder builder = BusinessProtocolEntities.TouristsUser.newBuilder();
        if (null != temporaryId) builder.setTemporaryId(temporaryId);
        if (null != nickname) builder.setNickname(nickname);
        if (null != avatar) builder.setAvatar(avatar);
        return builder.build();
    }
}
